<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <?php include_http_metas() ?>
    <?php include_metas() ?>
    <?php include_title() ?>
    <link rel="shortcut icon" href="../images/favicon.ico"></link>
    <link rel="shortcut icon" href="../../images/favicon.ico"></link>
    <link rel="shortcut icon" href="../../../images/favicon.ico"></link>
    <link rel="shortcut icon" href="../../../../images/favicon.ico"></link>
    <link rel="shortcut icon" href="../../../../../images/favicon.ico"></link>

    <?php use_javascript('jquery-1.3.2.min.js') ?>
    <?php use_javascript('jquery-ui-1.7.2.custom.min.js') ?>
    <?php use_javascript('fullcalendar.min.js') ?>
    <?php use_javascript('ui.core.js') ?>
    <?php use_javascript('ui.draggable.js') ?>
    <?php include_javascripts() ?>
    <?php use_helper('Javascript') ?>
    <?php use_helper('Date') ?>
    <?php include_stylesheets() ?>
    <?php //header("Refresh: 30")?>
  </head>

<body>
    <p class="hidden">
        <a href="#content">Skip to content</a>
    </p>
  
    <!-- INICIO PAGINA -->
    <div id="page">
  
    <!-- INICIO CONTENIDO ANTES DEL FOOTER -->
		<div id="nonFooter">
      
      <!-- INICIO HEADER -->
			<div id="header">
				<p id="logo">
					<span class="replacement"></span><a href="/gestdent/web/system.php"><span class="replacement"></span><span class="linkText">XXXX</span></a>

				</p>
				<ul id="menu">
					<li id="menuSupport">
						<!--<span class="replacement"></span><a href="#" title="Support and documentation"><span class="replacement"></span><span class="linkText">Support</span></a>-->
					</li>
          
          <?php if ($sf_user->isAuthenticated()): ?>
					<li id="menuAbout">
						<?php echo link_to('SALIR','@sf_guard_signout') ?>
						<?php //echo $sf_params->get('total') ?>
						<?php //echo  $sf_user->getGuardUser()->getAttribute('paciente', 'Paciente an�nimo') ?>

						
					</li>
					<li id="menuSupport">
						<?php //echo link_to('Usuario: ' . $sf_user->getGuardUser()->getUsername(),'@sf_guard_signout') ?>
						<a><?php echo 'Usuario: ' . $sf_user->getGuardUser()->getUsername() ?></a>
					</li>
          <?php endif; ?>
          
				</ul>                                                                                                                                        
				
				
			</div>
<!--
<div id="selpaciente">
  Recent viewed jobs:
  <ul>
    <?php //foreach ($sf_user->getPacienteHistory() as $gestdent_paciente): ?>
      <li>
        <?php //echo link_to($gestdent_paciente->getRut().' - '.$gestdent_paciente->getNombres(), 'paciente_show_user', $gestdent_paciente) ?>
	<?php //echo ($gestdent_paciente->getRut().' - '.$gestdent_paciente->getNombres()) ?>
      </li>
    <?php //endforeach; ?>
  </ul>
</div>
-->

<!--
<div id="selpaciente">
  Recent viewed job222:
  <ul>
    <?php $gestdent_paciente2 = $sf_user->getSessionPaciente()?>
    <?php //echo ($gestdent_paciente2->getRut().' - '.$gestdent_paciente2->getNombres()) ?>
  </ul>
</div>
-->
      <!-- FIN HEADER -->
            
      <!-- INICIO CONTENIDO Y MENU -->
      
      
  <!--
  <div style=" OVERFLOW: auto; WIDTH: 100px; TOP: 48px;">
 fsdfsdfsdfsdfsdfsdfddfdfsfdsdddddddddddddddddddddddddddddddddd
 sdfsdfdsffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcvcxvxvxcvxcvvxcvxcvx
 vxcvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvxxxxxxxxxvcxvcvcvcxvxcvxcvcxv
 xcvxcccccccccccccccccccccccccccccccccccxxxxxxxxxxxxxxxxxxxxcvvxcvxcv
 fsdfsdfsdfsdfsdfsdfddfdfsfdsdddddddddddddddddddddddddddddddddd
 sdfsdfdsffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcvcxvxvxcvxcvvxcvxcvx
 vxcvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvxxxxxxxxxvcxvcvcvcxvxcvxcvcxv
 xcvxcccccccccccccccccccccccccccccccccccxxxxxxxxxxxxxxxxxxxxcvvxcvxcv
  fsdfsdfsdfsdfsdfsdfddfdfsfdsdddddddddddddddddddddddddddddddddd
 sdfsdfdsffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcvcxvxvxcvxcvvxcvxcvx
 vxcvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvxxxxxxxxxvcxvcvcvcxvxcvxcvcxv
 xcvxcccccccccccccccccccccccccccccccccccxxxxxxxxxxxxxxxxxxxxcvvxcvxcv
  fsdfsdfsdfsdfsdfsdfddfdfsfdsdddddddddddddddddddddddddddddddddd
 sdfsdfdsffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcvcxvxvxcvxcvvxcvxcvx
 vxcvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvxxxxxxxxxvcxvcvcvcxvxcvxcvcxv
 xcvxcccccccccccccccccccccccccccccccccccxxxxxxxxxxxxxxxxxxxxcvvxcvxcv
  fsdfsdfsdfsdfsdfsdfddfdfsfdsdddddddddddddddddddddddddddddddddd
 sdfsdfdsffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcvcxvxvxcvxcvvxcvxcvx
 vxcvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvxxxxxxxxxvcxvcvcvcxvxcvxcvcxv
 xcvxcccccccccccccccccccccccccccccccccccxxxxxxxxxxxxxxxxxxxxcvvxcvxcv
</div> -->

<div id="content">
	
         <?php if ($sf_user->isAuthenticated()): ?>
	 
	<div id=menu_container>


<ul class="cssMenu cssMenum0">
	<li class=" cssMenui0"><a class="  cssMenui0" href="#"><span>MENU</span><![if gt IE 6]></a><![endif]><!--[if lte IE 6]><table><tr><td><![endif]-->
	<ul class=" cssMenum">
		<li class=" cssMenui"><?php echo link_to('HORARIO','general/index', array('class' => 'cssMenui')) ?></li>
		<li class=" cssMenui"><?php echo link_to('RESERVA','general/index', array('class' => 'cssMenui')) ?></li>
		<li class=" cssMenui"><?php echo link_to('SELECCIONAR SUCURSAL','sucursal/seleccionar', array('class' => 'cssMenui')) ?></li>
		<li class=" cssMenui"><?php echo link_to('BUSCAR PACIENTE','general/index', array('class' => 'cssMenui')) ?></li>
	</ul>
	<!--[if lte IE 6]></td></tr></table></a><![endif]--></li>

	<li class=" cssMenui0"><a class="  cssMenui0" href="#"><span>MODULOS</span><![if gt IE 6]></a><![endif]><!--[if lte IE 6]><table><tr><td><![endif]-->
	<ul class=" cssMenum">
		<li class=" cssMenui"><?php echo link_to('HORARIO','general/index', array('class' => 'cssMenui')) ?>
                    <ul class=" cssMenumi0">
                        <li class=" cssMenui"><?php echo link_to('HORARIO','general/index', array('class' => 'cssMenui')) ?></li>
                        <li class=" cssMenui"><?php echo link_to('RESERVA','general/index', array('class' => 'cssMenui')) ?></li>
                        <li class=" cssMenui"><?php echo link_to('SELECCIONAR SUCURSAL','sucursal/seleccionar', array('class' => 'cssMenui')) ?></li>
                        <li class=" cssMenui"><?php echo link_to('BUSCAR PACIENTE','general/index', array('class' => 'cssMenui')) ?></li>
                    </ul>
                </li>
		<li class=" cssMenui"><?php echo link_to('RESERVA','general/index', array('class' => 'cssMenui')) ?></li>
		<li class=" cssMenui"><?php echo link_to('SELECCIONAR SUCURSAL','sucursal/seleccionar', array('class' => 'cssMenui')) ?></li>
		<li class=" cssMenui"><?php echo link_to('BUSCAR PACIENTE','general/index', array('class' => 'cssMenui')) ?></li>
	</ul>
	<!--[if lte IE 6]></td></tr></table></a><![endif]--></li>



	 <?php //if ($sf_user->hasCredential('admin')): ?>
	<li class=" cssMenui0"><a class="  cssMenui0" href="#"><span>CONFIGURACION</span>
	<![if gt IE 6]></a><![endif]><!--[if lte IE 6]><table><tr><td><![endif]-->
	<ul class=" cssMenum">
		<!--
		<li class=" cssMenui"><a class="  cssMenui" href="#">Template 1</a></li>
		<li class=" cssMenui"><a class="  cssMenui" href="#">Template 2</a></li>
		<li class=" cssMenui"><a class="  cssMenui" href="#">Template 3</a></li>
		<li class=" cssMenui"><a class="  cssMenui" href="#">Template 4</a></li>
		<li class=" cssMenui"><a class="  cssMenui" href="#">Template 5</a></li>
		<li class=" cssMenui"><a class="  cssMenui" href="#">Template 6</a></li>
		-->
		
		 <?php if ($sf_user->hasCredential('config-afp')): ?>
		<li class=" cssMenui"><?php echo link_to('AFP','afp/index', array('class' => 'cssMenui')) ?></li>
		<?php endif; ?>
		
		<?php if ($sf_user->hasCredential('config-cargo')): ?>
		<li class=" cssMenui"><?php echo link_to('CARGOS','cargo/index', array('class' => 'cssMenui')) ?></li>
		<?php endif; ?>
		
		<?php if ($sf_user->hasCredential('config-hora')): ?>
		<li class=" cssMenui"><?php echo link_to('HORA','hora/index', array('class' => 'cssMenui')) ?></li>
		<?php endif; ?>

		<?php if ($sf_user->hasCredential('config-horario')): ?>
		<li class=" cssMenui"><?php echo link_to('HORARIO','horario3/index', array('class' => 'cssMenui')) ?></li>
		<?php endif; ?>

		<?php if ($sf_user->hasCredential('config-paciente')): ?>
		<li class=" cssMenui"><?php echo link_to('PACIENTE','paciente/index', array('class' => 'cssMenui')) ?></li>
		<?php endif; ?>
		
		<?php if ($sf_user->hasCredential('config-permiso')): ?>
		<li class=" cssMenui"><?php echo link_to('PERMISOS','@sf_guard_permission', array('class' => 'cssMenui')) ?></li>
		<?php endif; ?>
		
		<?php if ($sf_user->hasCredential('config-personal')): ?>
		<li class=" cssMenui"><?php echo link_to('PERSONAL','personal/index', array('class' => 'cssMenui')) ?></li>		
		<?php endif; ?>

		<?php if ($sf_user->hasCredential('config-reserva')): ?>
		<li class=" cssMenui"><?php echo link_to('RESERVA','reserva/listarxdia', array('class' => 'cssMenui')) ?></li>
		<?php endif; ?>

		<?php if ($sf_user->hasCredential('config-sucursal')): ?>
		<li class=" cssMenui"><?php echo link_to('SUCURSAL','sucursal/index', array('class' => 'cssMenui')) ?></li>
		<?php endif; ?>
		
		<?php if ($sf_user->hasCredential('config-usuario')): ?>
		<li class=" cssMenui"><?php echo link_to('USUARIOS','@sf_guard_user', array('class' => 'cssMenui')) ?></li>
		<?php endif; ?>
		
	</ul>
	<!--[if lte IE 6]></td></tr></table></a><![endif]-->
	</li>
	<?php //endif; ?>


	<!--
	<li class=" cssMenui0"><a class="  cssMenui0" href="#">FAQ</a></li>
	<li class=" cssMenui0"><a class="  cssMenui0" href="#">Contact Us</a></li>
	-->
</ul>

<ul class="cssMenu cssMenum0">

        <li class=" cssMenui0"><a class="  cssMenui0" href="<?php echo url_for('paciente/search') ?>"><span>PACIENTE ACTUAL: <?php echo $sf_user->getSessionPacienteDetail() ?></span><![if gt IE 6]></a><![endif]><!--[if lte IE 6]><table><tr><td><![endif]-->
        <ul class=" cssMenum">
		<li class=" cssMenui"><?php //echo link_to('HORARIO','horario/listar', array('class' => 'cssMenui')) ?></li>
		<li class=" cssMenui"><?php //echo link_to('RESERVA','reserva/index', array('class' => 'cssMenui')) ?></li>
		<li class=" cssMenui"><?php //echo link_to('BUSCAR PACIENTE','horario/modal', array('class' => 'cssMenui')) ?></li>
	<li class=" cssMenui"><?php echo link_to('BUSCAR PACIENTE','paciente/search', array('class' => 'cssMenui')) ?></li>
	<li class=" cssMenui"><?php echo link_to('BORRAR SELECCION','paciente/pds', array('class' => 'cssMenui')) ?></li>
	<li class=" cssMenui"><?php echo link_to('RESERVAR HORA','reserva/listarxdia', array('class' => 'cssMenui')) ?></li>
	<li class=" cssMenui"><?php echo link_to('DOCTORES','personal/doctor', array('class' => 'cssMenui')) ?></li>
	<li class=" cssMenui"><?php echo link_to('ATENDER','paciente/search', array('class' => 'cssMenui')) ?></li>
        <li class=" cssMenui"><?php echo link_to('RECAUDAR PAGO','paciente/search', array('class' => 'cssMenui')) ?></li>

        </ul>
    </li>
</ul>

<?php
//echo link_to('Herramienta de Colores', 'paciente/index',array('popup'=>array('popupWindow', 'status=no,location=yes,resizable=no,width=610,height=400,left=320,top=0')))
?>


<?php //echo link_to_function('&iexcl;P&iacute;nchame!', "alert('Me has pinchado')") ?>


<!--
<div id="dialog" title="Create new user">
    
	<p id="validateTips">All form fields are required.</p>

	<form>
	<fieldset>
		<label for="name">Nombreeeeeeeeeeeeee</label>
		<input type="text" name="name" id="name" class="text ui-widget-content ui-corner-all" />
		<label for="email">Emailllllllllllllllllllll</label>
		<input type="text" name="email" id="email" value="" class="text ui-widget-content ui-corner-all" />
		<label for="password">Passwordddddddddddddd</label>
		<input type="password" name="password" id="password" value="" class="text ui-widget-content ui-corner-all" />
	</fieldset>
	</form>

</div>
-->

<!--
<div class="demo">

<p>Date: <input id="datepicker" type="text"></p>

</div>

<div id="dialog" title="Basic modal dialog">
	<p>Adding the modal overlay screen makes the dialog look more prominent because it dims out the page content.</p>
</div>-->




	
	<script type="text/javascript">	
		$(function() {
		$("#dialog").dialog({
			bgiframe: true,
			height: 140,
			widght: 140,
			modal: true
		});
	});
	</script>




<script type="text/javascript">
$(function() {
		
		var name = $("#name"),
			email = $("#email"),
			password = $("#password"),
			allFields = $([]).add(name).add(email).add(password),
			tips = $("#validateTips");

		function updateTips(t) {
			tips.text(t).effect("highlight",{},1500);
		}

		function checkLength(o,n,min,max) {

			if ( o.val().length > max || o.val().length < min ) {
				o.addClass('ui-state-error');
				updateTips("Length of " + n + " must be between "+min+" and "+max+".");
				return false;
			} else {
				return true;
			}

		}

		function checkRegexp(o,regexp,n) {

			if ( !( regexp.test( o.val() ) ) ) {
				o.addClass('ui-state-error');
				updateTips(n);
				return false;
			} else {
				return true;
			}

		}
		
		$("#dialog").dialog({
			bgiframe: true,
			autoOpen: false,
			height: 300,
			modal: true,
			buttons: {
				'Create an account': function() {
					var bValid = true;
					allFields.removeClass('ui-state-error');

					bValid = bValid && checkLength(name,"username",3,16);
					bValid = bValid && checkLength(email,"email",6,80);
					bValid = bValid && checkLength(password,"password",5,16);

					bValid = bValid && checkRegexp(name,/^[a-z]([0-9a-z_])+$/i,"Username may consist of a-z, 0-9, underscores, begin with a letter.");
					// From jquery.validate.js (by joern), contributed by Scott Gonzalez: http://projects.scottsplayground.com/email_address_validation/
					bValid = bValid && checkRegexp(email,/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i,"eg. ui@jquery.com");
					bValid = bValid && checkRegexp(password,/^([0-9a-zA-Z])+$/,"Password field only allow : a-z 0-9");
					
					if (bValid) {
						$('#users tbody').append('<tr>' +
							'<td>' + name.val() + '</td>' + 
							'<td>' + email.val() + '</td>' + 
							'<td>' + password.val() + '</td>' +
							'</tr>'); 
						$(this).dialog('close');
					}
				},
				Cancel: function() {
					$(this).dialog('close');
				}
			},
			close: function() {
				allFields.val('').removeClass('ui-state-error');
			}
		});
		
		
		
		$('#create-user').click(function() {
			$('#dialog').dialog('open');
		})
		.hover(
			function(){ 
				$(this).addClass("ui-state-hover"); 
			},
			function(){ 
				$(this).removeClass("ui-state-hover"); 
			}
		).mousedown(function(){
			$(this).addClass("ui-state-active"); 
		})
		.mouseup(function(){
				$(this).removeClass("ui-state-active");
		});

	});
	</script>





        </div>


<!-- TOOLBAR -->
<div id="toolbarcontainer">
    <ul id="bubble">

      <li id="bubble">
         <a href="<?php echo url_for('paciente/search'); ?>"title="Buscar Paciente">
         <?php echo image_tag('/images/toolbar/search_small.png', array("class" => "small")); ?>
         <?php echo image_tag('/images/toolbar/search_medium.png', array("class" => "large")); ?>
         </a>
      </li>

      <li>
         <a href="<?php //echo url_for('paciente/search'); ?>"title="Titulo">
         <?php echo image_tag('/images/toolbar/doctor_small.png', array("class" => "small")); ?>
         <?php echo image_tag('/images/toolbar/doctor_medium.png', array("class" => "large")); ?>
         </a>
      </li>

      <li>
         <a href="<?php //echo url_for('paciente/search'); ?>"title="Titulo">
         <?php echo image_tag('/images/toolbar/calendar_small.png', array("class" => "small")); ?>
         <?php echo image_tag('/images/toolbar/calendar_medium.png', array("class" => "large")); ?>
         </a>
      </li>

      <li>
         <a href="<?php //echo url_for('paciente/search'); ?>"title="Horarios">
         <?php echo image_tag('/images/toolbar/clock_small.png', array("class" => "small")); ?>
         <?php echo image_tag('/images/toolbar/clock_medium.png', array("class" => "large")); ?>
         </a>
      </li>

      <li>
         <a href="<?php //echo url_for('paciente/search'); ?>"title="Titulo">
         <?php echo image_tag('/images/toolbar/key_small.png', array("class" => "small")); ?>
         <?php echo image_tag('/images/toolbar/key_medium.png', array("class" => "large")); ?>
         </a>
      </li>

      <li>
         <a href="<?php //echo url_for('paciente/search'); ?>"title="Titulo">
         <?php echo image_tag('/images/toolbar/graphic_small.png', array("class" => "small")); ?>
         <?php echo image_tag('/images/toolbar/graphic_medium.png', array("class" => "large")); ?>
         </a>
      </li>

      <li>
         <a href="<?php //echo url_for('paciente/search'); ?>"title="Titulo">
         <?php echo image_tag('/images/toolbar/printer_small.png', array("class" => "small")); ?>
         <?php echo image_tag('/images/toolbar/printer_medium.png', array("class" => "large")); ?>
         </a>
      </li>
        
        
    </ul>
</div>






	<?php endif; ?>
     
        <!-- INICIO CONTENIDO -->
	<div id="contentMainB">
	<center>
        <?php echo $sf_content ?>
        </center>
	</div>
        <!-- FIN CONTENIDO -->
        <div class="clearer"></div>

</div>
      <!-- FIN CONTENIDO Y MENU -->
      
		</div>
    <!-- FIN CONTENIDO ANTES DEL FOOTER -->
	</div>
  <!-- FIN PAGINA -->
	
  <!-- INICIO FOOTER -->
  <div id="footer">
		<ul id="bottomLinks">
			<li class="first">
				<a href="#">Soporte</a>
			</li>
			<li>
				<a href="#">Desarrollo</a>
			</li>
			<li>
				<a href="#">Contacto</a>
			</li>
		</ul>
		<p>
                        <?php date_default_timezone_set("Chile/Continental"); ?>
                        GESTDENT 1.0 - AMEDENT &copy; 2009.
		</p>
	</div>
  <!-- FIN FOOTER -->
<?php include_javascripts() ?>
</body></html>